using System;
using System.Collections.Generic;
using System.Text;
using CommunityServer;
using CommunityServer.Components;
using CommunityServer.Blogs.Components;
using CommunityServer.Components.SearchBarrel;

namespace CommunityServerStuff.SearchBarrel
{
    class ContentBarrelItem : BarrelItem
    {

        #region Properties

        #region ApplicationType

        public override ApplicationType ApplicationType
        {
            get
            {
                return ApplicationType.ContentManagement;
            }
        }

        #endregion

        #endregion

        #region Methods

        #region Format

        public override void Format(IndexPost post)
        {

            Content content = Contents.GetContent(post.PostID, false);
            if (!string.IsNullOrEmpty(SiteUrls.Instance().UrlData.FormatUrl(post.Name)))
            {
                post.Url = SiteUrls.Instance().UrlData.FormatUrl(post.Name);
            }
            else
            {
                post.Url = Contents.ArticleUrl(post.Name);
            }
            post.ApplicationUrl = SiteUrls.Instance().Home;

        }

        #endregion

        #endregion

    }
}